<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  props: {
    info: { type: Object, required: true },
  },
});
</script>

<template>
  <view class="jps-item">
    <view class="jps-item-cover">
      <image class="jps-item-img" :src="info.cover_pic" mode="aspectFill" />
      <view class="jps-item-vip">
        <image
          class="jps-item-vip2"
          src="@/package/novice/static/index-jps.png"
        />
        会员专享
      </view>
      <view class="jps-item-scenic">
        <image
          class="jps-item-scenic2"
          src="@/package/novice/static/index-train.png"
        />
        {{ info.scenic_name }}
      </view>
    </view>
    <view class="jps-item-content">
      <view class="jps-item-name">{{ info.product_name }}</view>
      <view class="jps-item-btn">预约报名</view>
    </view>
  </view>
</template>

<style lang="scss">
.jps-item {
  .jps-item-cover {
    position: relative;
  }

  .jps-item-img {
    display: block;
    width: 100%;
    height: 252rpx;
    border-radius: 20rpx 20rpx 0 0;
  }

  .jps-item-vip {
    position: absolute;
    left: 18rpx;
    top: 0;
    width: 112rpx;
    padding-left: 10rpx;
    font-size: 20rpx;
    color: #ffffff;
    line-height: 40rpx;
    text-align: center;
    border-bottom-right-radius: 20rpx;
    background: linear-gradient(90deg, #b45f0c 9%, #76470c 100%);
  }

  .jps-item-vip2 {
    position: absolute;
    left: -18rpx;
    top: 0;
    width: 40rpx;
    height: 40rpx;
  }

  .jps-item-scenic {
    position: absolute;
    left: 10rpx;
    bottom: 10rpx;
    display: flex;
    align-items: center;
    height: 32rpx;
    padding: 0 10rpx;
    font-size: 20rpx;
    color: #ffffff;
    border-radius: 8rpx;
    background: rgba(0, 0, 0, 0.6);
  }

  .jps-item-scenic2 {
    width: 20rpx;
    height: 20rpx;
    margin-right: 6rpx;
  }

  .jps-item-content {
    padding: 20rpx;
  }

  .jps-item-name {
    height: 84rpx;
    margin-bottom: 20rpx;
    font-size: 30rpx;
    color: #333333;
    line-height: 42rpx;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    text-overflow: ellipsis;
    overflow: hidden;
  }

  .jps-item-btn {
    font-size: 24rpx;
    color: #ffffff;
    line-height: 62rpx;
    text-align: center;
    border-radius: 32rpx;
    background: linear-gradient(206deg, #fe810a 0%, #faa360 100%);
  }
}
</style>